package demo509;
import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;
public class EmployeelO {
    public static void main(String[] args) {
        Employee employee1 = new Employee("张三", 25, 8000.0);
        Employee employee2 = new Employee("李四", 30, 10000.0);
        Employee employee3 = new Employee("王五", 35, 12000.0);

        try (BufferedWriter writer = new BufferedWriter(new FileWriter("employees.txt"))) {
            writer.write(employee1.toString() + "\n");
            writer.write(employee2.toString() + "\n");
            writer.write(employee3.toString() + "\n");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
